cmake_minimum_required(VERSION 2.8)
project(commonlib)
add_compile_options(-std=c++0x)
#add_definitions(-Wall -g)# -Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib)

#set(CMAKE_MACOSX_RPATH 0)
#set(CMAKE_SKIP_BUILD_RPATH TRUE)
#set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# most of include files are in the folder "./include/util"
# and included by "#include util/xxx.h", so "./include" need to add to inc-path.
include_directories(. ./include)


# define {SRC} as ".", and {JSONSRC} as "./json"
#aux_source_directory(. SRC)
#aux_source_directory(./json JSONSRC)
# I want to use the source file from {SRC} & {JSONSRC} to build a shared lib, named "wzutil".
#add_library(wzutil SHARED ${SRC} ${JSONSRC})

aux_source_directory(. SRC)
add_library(wzutil SHARED ${SRC})

# The output path when building.
set(LIBRARY_OUTPUT_PATH ./lib)

# settings for "make install"
install(TARGETS wzutil          # set for target wzutil
        LIBRARY DESTINATION lib # the /usr/local by default and add this set "lib" make full path by default is "/usr/local/lib"
)

